class Test(object):
    def __init__(self):
        self.__number = 100

    def set_number(self,newNumber):
        print("---setter---")
        self.__number = newNumber

    def get_number(self):
        print("----getter----")
        return self.__number

    # 通过property()绑定getter和setter方法
    num = property(get_number,set_number)

    # 不能调换property()中getter和setter的位置
    # num = property(set_number,get_number)


t = Test()
t.num = 200
print(t.num)
